﻿using LibNiconico.NiconicoApi.Internal;
using LibNiconico.NiconicoApi.Lives.Comments;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace NiconicoApiHelperUnitTest
{
    [TestFixture]
    public class LiveChatCommentUnitTest
    {
        [TestCase(-999,NiconicoCommentScoreRank.None)]
        [TestCase(-1000, NiconicoCommentScoreRank.LittleNg)]
        [TestCase(-4799,NiconicoCommentScoreRank.LittleNg)]
        [TestCase(-4800,NiconicoCommentScoreRank.MediumNg)]
        [TestCase(-9999, NiconicoCommentScoreRank.MediumNg)]
        [TestCase(-10000, NiconicoCommentScoreRank.ManyNg)]
        public void CommentScoreTest(int score, NiconicoCommentScoreRank rank)
        {
            var element = new XElement("root");
            element.SetAttributeValue("score",score);
            var liveComment = NicoLiveChatComment.Parse(element);

            Assert.AreEqual(liveComment.CommentScoreRank, rank);
        }
    }
}
